/**********************************************************************************************************************
 *
 * Project:    mGameEngine
 * File:       segment.h
 * Author:     karooolek
 * Created on: 2009-10-08
 *
 **********************************************************************************************************************/

#ifndef SEGMENT_H_
#define SEGMENT_H_

#include "shape.h"
#include "vector3.h"

namespace mGameEngine
{

/**
 * Segment in three-dimensional space.
 */
class Segment : public Shape
{
private:
    /**
     * Start.
     */
    Vector3 _a;

    /**
     * End.
     */
    Vector3 _b;

public:
    /**
     * Create segment with specified ends.
     * @param a start.
     * @param b end.
     */
    Segment(const Vector3 &a = Vector3(0.0f, 0.0f, 0.0f),
            const Vector3 &b = Vector3(1.0f, 0.0f, 0.0f));

    /**
     * Destroy segment.
     */
    ~Segment();

    /**
     * Get segment start.
     * @return segment start.
     */
    const Vector3 &getStart() const
    {
        return _a;
    }

    /**
     * Set segment start.
     * @param a segment start.
     */
    void setStart(const Vector3 &a)
    {
        _a = a;
    }

    /**
     * Get segment end.
     * @return segment end.
     */
    const Vector3 &getEnd() const
    {
        return _b;
    }

    /**
     * Set segment end.
     * @param b segment end.
     */
    void setEnd(const Vector3 &b)
    {
        _b = b;
    }
};

}

#endif // SEGMENT_H_
